﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using WorldSource.Components;

namespace WorldSource.Entities
{
    public class Player : GameObject
    {
        Camera cam = new Camera();
        public Vector2 movementVector = Vector2.Zero;
        const int moveSpeed = 5;
        public Player(Game game, Texture2D texture)
            : base(game, texture)
        {
            Camera.mainCamera = cam;
            components.Add(cam);
        }

        public override void Update(GameTime gameTime)
        {
            if (movementVector != Vector2.Zero)
            {
                movementVector.Normalize();
            }
            Position += movementVector * moveSpeed;
            movementVector = Vector2.Zero;
            cam.UpdateCam(Position, 0, new Vector3(1, 1, 1));
            base.Update(gameTime);
        }
    }
}
